package ru.mipt.victator.pagerank.index;

import java.io.IOException;
import java.util.Iterator;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.Reporter;

import ru.mipt.victator.pagerank.Value;

public class IndexReduce extends MapReduceBase implements Reducer
{

	@SuppressWarnings("unchecked")
	@Override
	public void reduce(WritableComparable key, Iterator values,
			OutputCollector output, Reporter reporter) throws IOException
	{
		while (values.hasNext())
		{
			output.collect(key, (Value)values.next());
	    }
	}

}
